<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('机构校区表修改')"/>
</head>
<body>
<form class="layui-form" action=""  th:object="${Campus}">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">
				<div class="layui-form-item layui-hide">
                    <label class="layui-form-label">id</label>
                    <div class="layui-input-block">
                        <input type="text" th:value="*{id}" name="id" lay-verify="title"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>

				<div class="layui-form-item">
                    <label class="layui-form-label">名称</label>
                    <div class="layui-input-block">
                        <input th:value="*{name}" type="text" name="name" autocomplete="off" placeholder="名称" class="layui-input">
                    </div>
                </div>

				<div class="layui-form-item">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-block">
                        <input th:value="*{cover}" type="text" name="cover" autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>

				<div class="layui-form-item">
                    <label class="layui-form-label">所在省份</label>
                    <div class="layui-input-block">
                        <input th:value="*{provinceId}" type="text" name="provinceId" autocomplete="off" placeholder="所在省份" class="layui-input">
                    </div>
                </div>

				<div class="layui-form-item">
                    <label class="layui-form-label">所在城市</label>
                    <div class="layui-input-block">
                        <input th:value="*{cityId}" type="text" name="cityId" autocomplete="off" placeholder="所在城市" class="layui-input">
                    </div>
                </div>

				<div class="layui-form-item">
                    <label class="layui-form-label">详细地址</label>
                    <div class="layui-input-block">
                        <input th:value="*{address}" type="text" name="address" autocomplete="off" placeholder="详细地址" class="layui-input">
                    </div>
                </div>

				<div class="layui-form-item">
                    <label class="layui-form-label">所属机构</label>
                    <div class="layui-input-block">
                        <input th:value="*{mechanismId}" type="text" name="mechanismId" autocomplete="off" placeholder="所属机构" class="layui-input">
                    </div>
                </div>

				<div class="layui-form-item">
                    <label class="layui-form-label">状态 0 禁用  1 启用</label>
                    <div class="layui-input-block">
                        <input th:value="*{status}" type="text" name="status" autocomplete="off" placeholder="状态 0 禁用  1 启用" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit=""
                    lay-filter="campus-update">
                <i class="layui-icon layui-icon-ok"></i>
				提交
            </button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
				重置
            </button>
        </div>
    </div>
</form>
<th:block th:include="include :: footer"/>
<script>
    layui.use(['form','laydate','jquery'], function () {
        let form = layui.form;
        let $ = layui.jquery;
        let MODULE_PATH = rootPath+"/CampusController";
		
        form.on('submit(campus-update)', function (data) {
            $.ajax({
                url: MODULE_PATH+'/edit',
                data: data.field,
                dataType: 'json',
                contentType: 'application/x-www-form-urlencoded',
                type: 'post',
                success: function (result) {
                    if (result.code==200) {
                        layer.msg(result.msg, {icon: 1, time: 1000}, function () {
                            parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
                            parent.layui.table.reload("campus-table");
                        });
                    } else {
                        layer.msg(result.msg, {icon: 2, time: 1000});
                    }
                }
            })
            return false;
        });
    })
</script>
<script>
</script>
</body>
</html>